/*
 * @Author: jwb jwb@yoc.tech
 * @Date: 2022-05-18 11:34:26
 * @LastEditors: jwb jwb@yoc.tech
 * @LastEditTime: 2022-05-18 11:51:58
 * @FilePath: \mPaaS-uniapp-tutorial\src\router\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import {RouterMount,createRouter} from 'uni-simple-router';


// 若需要配置路由拦截与权限404，需再当前变量设置重定向
// ROUTES是通过read-page读取的pages.json中的根菜单列表
const routes = [
    ...ROUTES
]
const router = createRouter({
	platform: process.env.VUE_APP_PLATFORM,  
	routes
});
//全局路由前置守卫
router.beforeEach((to, from, next) => {
	next();
});
// 全局路由后置守卫
router.afterEach((to, from) => {
    console.log('跳转结束')
})

export {
	router,
	RouterMount
}
